<p>Hello&nbsp;<span
        style="color:rgb(0,0,0);line-height:12px;font-family:Arial,Helvetica,sans-serif"><?php echo $order['User']['fullname']; ?></span>
</p>
<p>
    3DArcShop - The Best of 3D Models for Architecture</p>
<p>
    <span style="font-family:arial,sans-serif;font-size:13px">Thank you for shopping with us.&nbsp;</span>You can check
    your order and link download below.</p>
<p>
    <span style="color:rgb(0,0,0);line-height:12px;font-family:Arial,Helvetica,sans-serif"></span></p>
<div style="padding:10px;border:1px solid rgb(238,238,238);font-size:12px">
<table style="width:100%;font-family:verdana;border-collapse:collapse" cellpadding="0" cellspacing="0">
    <tbody>
    <tr>
        <td style="padding:5px 10px;border:1px solid rgb(229,229,229)">
            <h2>Purchase Order</h2>

            <p>3DArcShop
            </p>
        </td>
    </tr>
    </tbody>
</table>
<?php
if ($order['Order']['payment_status'] == '1') {
    if (!empty($order_detail)) {
        foreach ($order_detail as $key => $value) {
            ?>
            <div style="overflow:hidden;margin:5px 0;">
                <p style="font-weight:bold"><?php echo $value['Product']['name']; ?></p>

                <div style="font-weight:bold;font-family:verdana">
                    <p>You have 2 times download for each link, Please download carefully. <br>
                        DOWNLOAD <span style="text-transform: uppercase"><?php echo $value['Product']['name']; ?></span>
                        :<br>
                        <?php if (!empty($value['ProductLink'])) {
                            foreach ($value['ProductLink'] as $link) {
                                ?>
                                <a href="<?php echo
                                    DOMAIN . 'User/download?quick_key=' . $link['ProductLink']['link_href']
                                    . '&order_id='
                                    . $order['Order']['id']; ?>"> <?php echo $link['ProductLink']['link_name']; ?>
                                </a><br/>
                            <?php
                            }
                        } ?>
                    </p></div>
            </div>
        <?php
        }
    }
} else {
    ?>
    <p style="text-align:center;margin:15px 0">
        <?php echo $this->Html->link(
            $this->Html->image(DOMAIN . 'images/paypal.gif', array('alt' => 'Payment via Paypal')),
            array('controller' => 'Paypal', 'action' => 'pay_by_order', $order['Order']['id']),
            array('escape' => false)
        ); ?>
    </p>
<?php } ?>
<table style="width:100%;font-family:verdana;border-collapse:collapse" cellpadding="0" cellspacing="0">
    <tbody>
    <tr>
        <th>Order Information</th>
    </tr>
    <tr>
        <td style="padding:5px 10px;border:1px solid rgb(229,229,229)">Order Number</td>
        <td style="padding:5px 10px;border:1px solid rgb(229,229,229)"><?php echo $order['Order']['id']; ?></td>
    </tr>
    <tr>
        <td style="padding:5px 10px;border:1px solid rgb(229,229,229)">Order Date</td>
        <td style="padding:5px 10px;border:1px solid rgb(229,229,229)"><?php echo $order['Order']['created']; ?></td>
    </tr>
    <tr>
        <td style="padding:5px 10px;border:1px solid rgb(229,229,229)">Order Status</td>
        <td style="padding:5px 10px;border:1px solid rgb(229,229,229)">
            <?php
            if ($order['Order']['payment_status'] == '1') {
                echo 'Completed';
            } else {
                if ($order['Order']['payment_status'] == '2') {
                    echo 'Failed';
                } else {
                    echo 'Pedding';
                }
            }
            ?>
        </td>
    </tr>
    </tbody>
</table>
<table style="width:100%;font-family:verdana;margin-top:20px;border-collapse:collapse" cellpadding="0" cellspacing="0">
    <tbody>
    <tr>
        <td style="padding:5px 10px;border:1px solid rgb(229,229,229);width:49%">
            <table style="width:100%;font-family:verdana;border-collapse:collapse" cellpadding="0" cellspacing="0">
                <tbody>
                <tr>
                    <td style="padding:5px 10px;border:1px solid rgb(229,229,229)" colspan="2"><b>Bill To</b></td>
                </tr>
                <tr>
                    <td style="padding:5px 10px;border:1px solid rgb(229,229,229)">Email</td>
                    <td style="padding:5px 10px;border:1px solid rgb(229,229,229)">
                        <p style="overflow:hidden">
                            <a href="mailto:<?php echo $order['User']['email']; ?>"
                               target="_blank"><?php echo $order['User']['email']; ?></a>
                        </p>
                    </td>
                </tr>
                <tr>
                    <td style="padding:5px 10px;border:1px solid rgb(229,229,229)">Company Name</td>
                    <td style="padding:5px 10px;border:1px solid rgb(229,229,229)"><?php echo $order['User']['company_name']; ?></td>
                </tr>
                <tr>
                    <td style="padding:5px 10px;border:1px solid rgb(229,229,229)">Title</td>
                    <td style="padding:5px 10px;border:1px solid rgb(229,229,229)"></td>
                </tr>
                <tr>
                    <td style="padding:5px 10px;border:1px solid rgb(229,229,229)">Full Name</td>
                    <td style="padding:5px 10px;border:1px solid rgb(229,229,229)"><?php echo $order['User']['fullname']; ?></td>
                </tr>
                <tr>
                    <td style="padding:5px 10px;border:1px solid rgb(229,229,229)">Address 1</td>
                    <td style="padding:5px 10px;border:1px solid rgb(229,229,229)"><?php echo $order['User']['address']; ?></td>
                </tr>
                <tr>
                    <td style="padding:5px 10px;border:1px solid rgb(229,229,229)">Address 2</td>
                    <td style="padding:5px 10px;border:1px solid rgb(229,229,229)"><?php echo $order['User']['address2']; ?></td>
                </tr>
                <tr>
                    <td style="padding:5px 10px;border:1px solid rgb(229,229,229)">City</td>
                    <td style="padding:5px 10px;border:1px solid rgb(229,229,229)"><?php echo $order['User']['city']; ?></td>
                </tr>
                <tr>
                    <td style="padding:5px 10px;border:1px solid rgb(229,229,229)">Zip/Postal Code</td>
                    <td style="padding:5px 10px;border:1px solid rgb(229,229,229)"><?php echo $order['User']['zipcode']; ?></td>
                </tr>
                <tr>
                    <td style="padding:5px 10px;border:1px solid rgb(229,229,229)">State/Province</td>
                    <td style="padding:5px 10px;border:1px solid rgb(229,229,229)"></td>
                </tr>
                <tr>
                    <td style="padding:5px 10px;border:1px solid rgb(229,229,229)">Country</td>
                    <td style="padding:5px 10px;border:1px solid rgb(229,229,229)"><?php echo $order['User']['country']; ?></td>
                </tr>
                <tr>
                    <td style="padding:5px 10px;border:1px solid rgb(229,229,229)">Phone</td>
                    <td style="padding:5px 10px;border:1px solid rgb(229,229,229)"><?php echo $order['User']['phone']; ?></td>
                </tr>
                </tbody>
            </table>
        </td>
        <td style="padding:5px 10px;border:1px solid rgb(229,229,229);width:49%">
            <table style="width:100%;font-family:verdana;border-collapse:collapse" cellpadding="0" cellspacing="0">
                <tbody>
                <tr>
                    <td style="padding:5px 10px;border:1px solid rgb(229,229,229)" colspan="2"><b>Ship To</b></td>
                </tr>
                <tr>
                    <td style="padding:5px 10px;border:1px solid rgb(229,229,229)">Email</td>
                    <td style="padding:5px 10px;border:1px solid rgb(229,229,229)">
                        <p style="overflow:hidden"><a href="mailto:<?php echo $order['User']['email']; ?>"
                                                      target="_blank"><?php echo $order['User']['email']; ?></a></p>
                    </td>
                </tr>
                <tr>
                    <td style="padding:5px 10px;border:1px solid rgb(229,229,229)">Company Name</td>
                    <td style="padding:5px 10px;border:1px solid rgb(229,229,229)"><?php echo $order['User']['company_name']; ?></td>
                </tr>
                <tr>
                    <td style="padding:5px 10px;border:1px solid rgb(229,229,229)">Title</td>
                    <td style="padding:5px 10px;border:1px solid rgb(229,229,229)"></td>
                </tr>
                <tr>
                    <td style="padding:5px 10px;border:1px solid rgb(229,229,229)">Full Name</td>
                    <td style="padding:5px 10px;border:1px solid rgb(229,229,229)"><?php echo $order['User']['fullname']; ?></td>
                </tr>
                <tr>
                    <td style="padding:5px 10px;border:1px solid rgb(229,229,229)">Address 1</td>
                    <td style="padding:5px 10px;border:1px solid rgb(229,229,229)"><?php echo $order['User']['address']; ?></td>
                </tr>
                <tr>
                    <td style="padding:5px 10px;border:1px solid rgb(229,229,229)">Address 2</td>
                    <td style="padding:5px 10px;border:1px solid rgb(229,229,229)"><?php echo $order['User']['address2']; ?></td>
                </tr>
                <tr>
                    <td style="padding:5px 10px;border:1px solid rgb(229,229,229)">City</td>
                    <td style="padding:5px 10px;border:1px solid rgb(229,229,229)"><?php echo $order['User']['city']; ?></td>
                </tr>
                <tr>
                    <td style="padding:5px 10px;border:1px solid rgb(229,229,229)">Zip/Postal Code</td>
                    <td style="padding:5px 10px;border:1px solid rgb(229,229,229)"><?php echo $order['User']['zipcode']; ?></td>
                </tr>
                <tr>
                    <td style="padding:5px 10px;border:1px solid rgb(229,229,229)">State/Province</td>
                    <td style="padding:5px 10px;border:1px solid rgb(229,229,229)"></td>
                </tr>
                <tr>
                    <td style="padding:5px 10px;border:1px solid rgb(229,229,229)">Country</td>
                    <td style="padding:5px 10px;border:1px solid rgb(229,229,229)"><?php echo $order['User']['country']; ?></td>
                </tr>
                <tr>
                    <td style="padding:5px 10px;border:1px solid rgb(229,229,229)">Phone</td>
                    <td style="padding:5px 10px;border:1px solid rgb(229,229,229)"><?php echo $order['User']['phone']; ?></td>
                </tr>
                </tbody>
            </table>
        </td>
    </tr>
    </tbody>
</table>
<table style="width:100%;font-family:verdana;margin-top:20px;border-collapse:collapse" cellpadding="0" cellspacing="0">
    <tbody>
    <tr>
        <th>Qty</th>
        <th>Name</th>
        <th>SKU</th>
        <th>Price</th>
        <th>Total</th>
    </tr>
    <?php
    $total_amout = 0;
    if (!empty($order_detail)) {
        foreach ($order_detail as $key => $value) {
            $amount = $value['Product']['price'] * $value['OrderDetail']['number_product'];
            $total_amout += $amount;
            ?>
            <tr>
                <td style="padding:5px 10px;border:1px solid rgb(229,229,229)"><?php echo $key + 1; ?></td>
                <td style="padding:5px 10px;border:1px solid rgb(229,229,229)"><?php echo $value['Product']['name']; ?></td>
                <td style="padding:5px 10px;border:1px solid rgb(229,229,229)"><?php echo $value['Product']['code']; ?></td>
                <td style="padding:5px 10px;border:1px solid rgb(229,229,229)"><?php echo $value['Product']['price']; ?> </td>
                <td style="padding:5px 10px;border:1px solid rgb(229,229,229)"><?php echo number_format(
                        $amount
                    ); ?></td>
            </tr>
        <?php
        }
    } ?>
    <tr>
        <td colspan="4" style="padding:5px 10px;border:1px solid rgb(229,229,229); text-align: right;">
            <strong>SubTotal: </strong></td>
        <td style="padding:5px 10px;border:1px solid rgb(229,229,229)"><?php echo number_format($total_amout); ?></td>
    </tr>
    <tr>
        <td colspan="4" style="padding:5px 10px;border:1px solid rgb(229,229,229); text-align: right;"><strong>Shipping
                and Handling Fee: </strong></td>
        <td style="padding:5px 10px;border:1px solid rgb(229,229,229)">€0</td>
    </tr>
    <tr>
        <td colspan="4" style="padding:5px 10px;border:1px solid rgb(229,229,229); text-align: right;"><strong
                style="color:#F00;">Total: </strong></td>
        <td style="padding:5px 10px;border:1px solid rgb(229,229,229)"><?php echo number_format($total_amout); ?></td>
    </tr>
    </tbody>
</table>
<table style="width:100%;font-family:verdana;margin-top:20px;border-collapse:collapse" cellpadding="0" cellspacing="0">
    <tbody>
    <tr>
        <th>
            Payment Information
        </th>
    </tr>
    <tr>
        <td style="padding:5px 10px;border:1px solid rgb(229,229,229)">Payment Method :</td>
        <td style="padding:5px 10px;border:1px solid rgb(229,229,229)">PayPal / Credit Card</td>
    </tr>
    </tbody>
</table>
<h3>Thank you!</h3>
</div>
<p></p>
<p>
    <span style="font-family:arial,sans-serif;font-size:13px">Questions? Problems?</span></p>
<p>
    <span style="font-family:arial,sans-serif;font-size:13px">E-mail:&nbsp;</span>
    <a style="color:rgb(17,85,204);font-family:arial,sans-serif;font-size:13px" href="mailto:3darcshop@gmail.com"
       target="_blank">3darcshop@gmail.com</a>
</p>
<p>&nbsp;</p>